package com.wsc.wsckeeper.persistence.dao;

import java.sql.SQLException;
import java.util.List;

import com.j256.ormlite.dao.Dao;
import com.wsc.wsckeeper.model.entity.AccountE;

@SuppressWarnings("rawtypes")
public class AccountDAO extends GenericDao {

	public static List<AccountE> queryForAll() throws SQLException, Exception {
		Dao<AccountE, Long> dao = getAccountDao();
		return dao.queryForAll();
	}

	public static AccountE create(AccountE account) throws SQLException, Exception {
		Dao<AccountE, Long> dao = getAccountDao();
		dao.create(account);
		return account;
	}

	public static int update(AccountE account) throws SQLException, Exception {
		Dao<AccountE, Long> dao = getAccountDao();
		return dao.update(account);
	}

	public static int delete(AccountE account) throws SQLException, Exception {
		Dao<AccountE, Long> dao = getAccountDao();
		return dao.delete(account);
	}
}
